package com.atguigu.gmall.search.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Document(indexName = "person")//这是一个文档
public class Person {
    @Id
    Long id;
    // 文本可以全文检索
    @Field(value = "name",type = FieldType.Text)
    String name;
    @Field(value = "age",type = FieldType.Integer)
    Long age;
}
